package cn.edu.jxyy.batistest.test;

import cn.edu.jxyy.batistest.mapper.UserMapper;
import cn.edu.jxyy.batistest.pojo.User;
import cn.edu.jxyy.batistest.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

public class Part11_Insert {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtils.getSession();
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);

        User user4Insert = new User();
        user4Insert.setUid(10);
        user4Insert.setUage(20);
        user4Insert.setUname("xiaoming111");

        int nVa = userMapper.addUser(user4Insert);
        System.out.println(nVa);
        System.out.println(user4Insert.getUid());


        sqlSession.commit();
        sqlSession.close();
    }
}
